package com.caow.baselibrary.widget

import android.app.Dialog
import android.content.Context
import android.view.Gravity
import com.caow.baselibrary.R

/**
 * @Author caow
 * 2022/12/9
 */
class LoadingDialog(context: Context) : Dialog(context, R.style.trans_dialog) {

    init {
        setContentView(R.layout.dialog_base_loading)
        //获取当前Activity所在的窗体
        val dialogWindow = window
        //设置Dialog从窗体底部弹出
        dialogWindow!!.setGravity(Gravity.CENTER)
        //获得窗体的属性
//        val lp = dialogWindow.attributes
//        lp.y = 0 //设置Dialog距离底部的距离
//        //宽度填满
//        lp.width = WindowManager.LayoutParams.MATCH_PARENT
//        //将属性设置给窗体
//        dialogWindow.attributes = lp
//        setCanceledOnTouchOutside(false)
//        setCancelable(false)

    }
}